package gameEngine;

import exceptions.IncorrectInputException;

public class Line {
	
	private Dot dot;
	private Player lineByPlayer;
	
	
	Line(Dot dot, Player lineByPlayer) throws IncorrectInputException{
		setFirstDot(dot);
		setLineByPlayer(lineByPlayer);
	
	}

	public Player getLineByPlayer() {
		return lineByPlayer;
	}

	private void setLineByPlayer(Player lineByPlayer) throws IncorrectInputException {
		if(lineByPlayer == null) throw new IncorrectInputException("Trying to set null player to line.");
		this.lineByPlayer = lineByPlayer;
	}

	public Dot getFirstDot() {
		return dot;
	}

	public void setFirstDot(Dot dot) throws IncorrectInputException {
		if(dot==null) throw new IncorrectInputException("The dot can't be null");
		this.dot = dot;
	}

}
